<template>
  <div>
    <ul>
      <li v-for="data in datalist" :key="data.fileId" @click="clickhandle(data)">
        {{data.name}}
      </li>
    </ul>

  </div>
</template>

<script>
import axios from 'axios'
export default {
 data () {
   return {
     datalist: ['111', '222', '333']
   }
 },
 mounted () {
    // axios.get("https://m.maizuo.com/gateway?cityId=110100&pageNum=1&pageSize=10&type=1&k=4271989").then(res=>{
    //   console.log(res.data);
    // })
    // $.ajax $.get
    axios({
      url: 'https://m.maizuo.com/gateway?cityId=110100&pageNum=1&pageSize=10&type=1&k=4271989',
      headers: {
        'X-Client-Info': '{"a":"3000","ch":"1002","v":"5.0.4","e":"15610855429195524981146"}',
        'X-Host': 'mall.film-ticket.film.list'
      }
    }).then(res => {
      console.log(res.data)
      this.datalist = res.data.data.films
    })
  },
 methods: {
   clickhandle (id) {
     this.$router.push(`/detail/${id}`)
   }
 }
}
</script>
